<?php /* @var $this Controller */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="vn" lang="vn">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="vn" />



	<!-- blueprint CSS framework -->
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
	<!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->

	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main_admin.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />

    <!-- config editor -->
    <script src="<?php echo Yii::app()->request->baseUrl; ?>/editor/elrte/js/jquery-1.6.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="<?php echo Yii::app()->request->baseUrl; ?>/editor/elrte/js/jquery-ui-1.8.13.custom.min.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/editor/elrte/css/smoothness/jquery-ui-1.8.13.custom.css" type="text/css" media="screen" charset="utf-8">
<!--     elRTE -->
    <script src="<?php echo Yii::app()->request->baseUrl; ?>/editor/elrte/js/elrte.min.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/editor/elrte/css/elrte.min.css" type="text/css" media="screen" charset="utf-8">
<!--     elRTE translation messages -->
    <script src="<?php echo Yii::app()->request->baseUrl; ?>/editor/elrte/js/i18n/elrte.ru.js" type="text/javascript" charset="utf-8"></script>

    <script src="<?php echo Yii::app()->request->baseUrl; ?>/editor/elrte/js/i18n/elrte.ru.js" type="text/javascript" charset="utf-8"></script>
    <script src="<?php echo Yii::app()->request->baseUrl; ?>/editor/elfinder/js/elfinder.min.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/editor/elfinder/css/elfinder.min.css" type="text/css" media="screen" charset="utf-8" />

    <link rel="stylesheet" type="text/css" media="screen" href="<?php echo Yii::app()->request->baseUrl; ?>/editor/elfinder/css/theme.css">
    <script src="<?php echo Yii::app()->request->baseUrl; ?>/js/common.js" type="text/javascript" charset="utf-8"></script>

<!--    hvl lib-->
    <script src="<?php echo Yii::app()->request->baseUrl; ?>/js/hvl-lib.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/css/hvl-lib.css" type="text/css" media="all">

<!--     end config editor -->
    <script type="text/javascript">
        function getDirectorFile(id)
        {
            $('<div />').dialogelfinder({
                url : '<?php echo Yii::app()->request->baseUrl; ?>/editor/elfinder/php/connector.php',
                commandsOptions: {
                    getfile: {
                        oncomplete: 'destroy' // destroy elFinder after file selection
                    }
                },
                getFileCallback: function(url){
                    $(id).val(url);
                }
            });
        }

        function getEditor(id,type,width,height)
        {
            //alert(height);
            var opts = {
                cssClass : 'el-rte',
                lang     : 'en',
                height   : height,
                width    : width,
                toolbar  : type,
                //tiny: only buttons to change text style (bold, italic, underline, strike, subscript, superscript)
                //compact: the same as tiny + save, undo/redo, text alignment, list, link, fullscreen
                //normal: compact + copy/paste, colors, paddings, block-elemet, images
                //complete: normal + text size, style and font formating
                //maxi: complete + tables
                fmAllow : true, //Allow use of file manager
                //height: 100,
                //width: 100,
                allowSource : false, //Allow edit in HTML
                absoluteURLs: true, //Make image URLs absolute
                cssfiles : ['<?php echo Yii::app()->request->baseUrl; ?>/editor/elrte/css/elrte-inner.css'],
                fmOpen : function(callback) {
                    $('<div />').dialogelfinder({
                        url : '<?php echo Yii::app()->request->baseUrl; ?>/editor/elfinder/php/connector.php',
                        commandsOptions: {
                            getfile: {
                                oncomplete: 'destroy' // destroy elFinder after file selection
                            }
                        },
                        getFileCallback: callback // pass callback to file manager
                    })
                }
            }
            $(id).elrte(opts);

        }
    </script>

    <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery.noty.packaged.min.js"></script>
    <link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/css/buttons.css" type="text/css" media="all">
    <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/theme.notify.js"></script>

    <script type="text/javascript">
        function generate(type,text) {
//        $.noty.defaults = {
//            layout: 'top',
//            theme: 'defaultTheme',
//            type: 'alert',
//            text: '', // can be html or string
//            dismissQueue: true, // If you want to use queue feature set this true
//            template: '<div class="noty_message"><span class="noty_text"></span><div class="noty_close"></div></div>',
//            animation: {
//                open: {height: 'toggle'},
//                close: {height: 'toggle'},
//                easing: 'swing',
//                speed: 500 // opening & closing animation speed
//            },
//            timeout: false, // delay for closing event. Set false for sticky notifications
//            force: false, // adds notification to the beginning of queue when set to true
//            modal: false,
//            maxVisible: 5, // you can set max visible notification for dismissQueue true option,
//            killer: false, // for close all notifications before show
//            closeWith: ['click'], // ['click', 'button', 'hover']
//            callback: {
//                onShow: function() {},
//                afterShow: function() {},
//                onClose: function() {},
//                afterClose: function() {}
//            },
//            buttons: false // an array of buttons
//        };
            var n = noty({text: 'noty - a jquery notification library!'});
            var n = noty({
                text        : text,
                type        : type,
                dismissQueue: true,
                timeout     : 5000, // delay for closing event. Set false for sticky notifications
                layout      : 'topRight',
                theme       : 'defaultTheme',
                maxVisible  : 10
            });
            console.log('html: ' + n.options.id);


        }
        //   generate('alert','abc');
        //    generate('information');
        //    generate('error');
        //    generate('warning');
        //    generate('notification');
        //    generate('success');

        function MyNotify(type,text)
        {
            $(".notify").addClass(type);
            $(".notify").text(text);
            $(".notify").show('slow').fadeOut(5000);
        }
    </script>
	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>

<body>

<div class="notify" style="display: none;position: fixed;padding:10px; top: 0; right: 0; border: 1px solid #000000; border-radius: 5px;background-color: #ffffff">
    notify
</div>

<div class="container" id="page">

	<div id="header">
		<div id="logo"><?php
            echo Config::model()->GetValue('name');
        ?></div>
	</div><!-- header -->

	<div id="mainmenu">
		<?php $this->widget('zii.widgets.CMenu',array(
			'items'=>array(
				array('label'=>'Trang chủ', 'url'=>array('/site/index'),'visible'=>!Yii::app()->user->isGuest),
				array('label'=>'Đăng nhập', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
				array('label'=>'Đăng xuất ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)
			),
		)); ?>
	</div><!-- mainmenu -->
	<?php if(isset($this->breadcrumbs)):?>
		<?php $this->widget('zii.widgets.CBreadcrumbs', array(
		    'homeLink'=>CHtml::link('Trang chủ', Yii::app()->homeUrl),
			'links'=>$this->breadcrumbs,
		)); ?><!-- breadcrumbs -->
	<?php endif?>
    <?php if(!Yii::app()->user->isGuest){ ?>
    <div id="submenu">
        <div class="title">Chức năng</div>
        <?php
            $this->widget('zii.widgets.CMenu',array(
                'items'=>array(
                    array('label'=>"Bài viết", 'url'=>array('baiviet/admin')),
                    array('label'=>"Nhóm Bài Viết", 'url'=>array('nhombaiviet/admin')),
                    array('label'=>"Menu", 'url'=>array('menu/admin')),
                    array('label'=>"Nhân Viên", 'url'=>array('user/admin')),
                    array('label'=>"Bác Sĩ", 'url'=>array('bacsi/admin')),
                    array('label'=>"Slide", 'url'=>array('slide/admin')),
                    array('label'=>"Liên Hệ", 'url'=>array('contact/admin')),
                    array('label'=>"Cấu Hình", 'url'=>array('config/admin'))
                )
            ))
        ?>
    </div>
    <?php }?>
	<?php echo $content; ?>

	<div class="clear"></div>

	<div id="footer">
		Copyright &copy; <?php echo date('Y'); ?> by <?php echo Config::model()->GetValue('www'); ?>.
		All Rights Reserved.<br/>
	</div><!-- footer -->

</div><!-- page -->

</body>
</html>
